﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    string lang = (Session["Language"] == null) ? "vi" : Session["Language"].ToString();
    string url = HttpContext.Current.Request.Url.AbsoluteUri;
}
@section script_arena
{
<script type="text/javascript">
    $(document).ready(function () {
        initialize();
        Validate();
    });

    function initialize() {
        var address = '@(((DatNuocViet.Models.GetWebResourceResult)ViewData["Map"]).ValueEn)';
        var geocoder = new google.maps.Geocoder();
        var mapOptions = {
            center: new google.maps.LatLng(10.765436, 106.699852),
            scrollwheel: false,
            zoom: 17,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map"),
            mapOptions);
        geocoder.geocode({ 'address': address }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                //10.765436,106.699852
                //map.setCenter(results[0].geometry.location);
                var dnv = new google.maps.LatLng(10.765436, 106.699852);
                map.setCenter(dnv);
                var marker = new google.maps.Marker({
                    map: map,
                    position: dnv,
                    animation: google.maps.Animation.BOUNCE
                });
            } else {
                alert("Location undefine: " + status);
            }
        });
    }

    function Validate() {
        $("#ContactForm").validate({
            rules: {
                Email: { required: true , email: true},
                FullName: { required: true},
                Subject: { required: true},
                Content: { required: true}
            },
            messages: {
                Email: { required: "*", email: "*" },
                FullName: { required: "*" },
                Subject: { required: "*" },
                Content: { required: "*" }
            }
        });
    }
</script>
<style type="text/css">
.contactUs-title
{
    margin: 10px 0 10px 0;
    font-size: 100%;
}
.contactUs-input input
{
    width:250px;
    height:20px;
    border:1px solid grey;
}
.contactUs-input textarea
{
    width:250px;
    height:150px;
    border:1px solid grey;
}
.contactUs-input input[type=submit]
{
    width:100px !important;
    height:30px!important;
    border:1px solid grey!important;
    margin: 10px 0 10px 0;
}
</style>
}

@section tourArea1
{
<div style="border:1px solid #F1EEEB">
    <h2 class="subtitle">
        @DatNuocViet.Ultility.Helper.Label("contactinfo")
    </h2>
    <div style="padding: 0 12px 12px 12px">
        <div style="color:#000000; line-height:20px !important; width:350px; float:left">
            @if(lang=="en")
            {
                @Html.Raw(((DatNuocViet.Models.GetWebResourceResult)ViewData["Contact"]).ValueEn)
            }
            else
            {
                @Html.Raw(((DatNuocViet.Models.GetWebResourceResult)ViewData["Contact"]).ValueVn)
            }
        </div>

        <div style="float:right">
            @using (Html.BeginForm("SendContact", "Contact", FormMethod.Post, new { id = "ContactForm", enctype = "multipart/form-data" }))
            {
            @*<p><strong>@DatNuocViet.Ultility.Helper.Label("contact")</strong></p>*@
            <div class="contactUs-title">Email</div>
            <div class="contactUs-input"><input type="text" name="Email" id="Email"/></div>
            
            <div class="contactUs-title">@DatNuocViet.Ultility.Helper.Label("fullname")</div>
            <div class="contactUs-input"><input type="text" name="FullName" id="FullName" /></div>
            
            <div class="contactUs-title">@DatNuocViet.Ultility.Helper.Label("subject")</div>
            <div class="contactUs-input"><input type="text" name="Subject" id="Subject"/></div>
            
            <div class="contactUs-title">@DatNuocViet.Ultility.Helper.Label("content")</div>
            <div class="contactUs-input"><textarea cols="1" rows="5" name="Content" id="Content"></textarea></div>
            
            <div class="contactUs-input"><input type="submit" value="@DatNuocViet.Ultility.Helper.Label("sendcontact")" /></div>
            }
        </div>

        <br />
        <div id="map" style="width:100%;height:300px;">
        </div>
        <br />
        
    </div>
</div>
}